/*
 * Copyright (C) 2020 The LINN Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package com.juqimiao.linn.exception;

/**
 *
 * 错误枚举。
 *
 * @author  Collin Cai
 */
public enum  BasicError implements ErrorI {

    // ---- Enumeration Members ----------/

    /**
     * 通用业务错误。 BaseCommand Business Error.
     */
    BUSINESS_ERROR("BUSINESS_ERROR", "通用的业务错误"),

    /**
     * LEDA框架错误。LEDA Framework Error.
     */
    FRAMEWORK_ERROR("LINN_FRAMEWORK_ERROR",
            "\'Light Event-driven And Domain-oriented Architecture\'框架错误"),

    /**
     * 未知系统错误。 Uknown System Error.
     */
    SYSTEM_ERROR("SYS_ERROR", "未知的系统错误");

    // ---- ErrorI Implementation ----------/

    // ---- Fields ----------/

    private String errorCode;

    private String errorDescription;

    // ---- Constructor ----------/

    /**
     * 构造器。
     * @param errorCode 错误带代码。
     * e.g: ""
     * @param errorDescription 错误信息。
     */
    BasicError(String errorCode, String errorDescription) {
        this.errorCode = errorCode;
        this.errorDescription = errorDescription;
    }
    // ---- Properties ----------/

    /**
     * 获取错误代码。
     * @return 错误代码。
     */
    @Override
    public String getErrorCode() {
        return this.errorCode;
    }

    /**
     * 获取错误信息。
     * @return 错误信息。
     */
    @Override
    public String getErrorMessage() {
        return this.errorDescription;
    }
}
